{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [
    "import sys\n",
    "sys.path.insert(0, \"..\")"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [
    "import altair as alt\n",
    "import datapane as dp\n",
    "from pathlib import Path\n",
    "import pandas as pd"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [
    "def gen_df(dim: int = 4) -> pd.DataFrame:\n",
    "    axis = [i for i in range(0, dim)]\n",
    "    data = {\"x\": axis, \"y\": axis}\n",
    "    return pd.DataFrame.from_dict(data)"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [
    "lis = [1, 2, 3]\n",
    "df = gen_df(10000)\n",
    "md_block = dp.Markdown(\"Test markdown block\")\n",
    "# list_asset = api.Asset.upload_obj(data=lis, title=\"List Asset\")\n",
    "plot_asset = dp.Plot(\n",
    "    data=alt.Chart(gen_df()).mark_line().encode(x=\"x\", y=\"y\"), caption=\"Plot Asset\"\n",
    ")\n",
    "df_asset = dp.DataTable(df=df, caption=\"Test Dataframe\")\n",
    "report = dp.Report(df_asset, md_block, plot_asset)"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [
    "report.preview()"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [
    "report.save(path=\"local report.html\", open=True)"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "source": [
    "report.tmp_report"
   ],
   "outputs": [],
   "metadata": {}
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
